<template>
    <div class="left-chart-1">
        <div class="lc1-chart">
            <pie-chart :options="pieOptions" style="width: 100%; height: 360px;"></pie-chart>
        </div>

    </div>
</template>

<script setup name="servicePlanterBar">
import { listServiceTypeSummary } from '@/api/statistics/plant_service';
import PieChart from '@/views/dashboard/components/datav/PieChart.vue';
import dayjs from "dayjs";

const planterList = ref([]);
const currentYear = dayjs().year().toString();


const pieOptions = reactive({
    title: {
        text: '服务类型分布'
    },
    legend: {
        left: "right",
        orient: "vertical",
        align: "right",
        textStyle: {
            color: '#fff', 
            fontSize: 14
        },
    },
    series: []
})


function getList() {
    listServiceTypeSummary({ "year": currentYear }).then(response => {
        pieOptions.series = response.rows;

    });
}

getList()
</script>

<style lang="scss" scoped>
.left-chart-1 {
    width: 100%;
    display: flex;
    flex-grow: 0;
    flex-direction: column;
    height: 415px;
    padding: 20px;


    .lc1-chart {
        flex: 1;
        height: 100%;
    }
}
</style>
